<?php
    class dal {
        private $servidor;
        private $usuario;
        private $password;
        private $database;
        
        public function dal (){
            $this->servidor ="localhost";
            $this->usuario ="root";
            $this->password= "root";
            $this->database="usr_sicob";
        }     
        public function conexion(){
            $cnx = new mysqli($this->servidor,  $this->usuario, $this->password, $this->database);
            if(mysqli_connect_errno()){
                echo "Conexion Fallida: ".mysqli_connect_errno();
                exit();
            }
            return $cnx;
        }
        public function execute ($sql){
            $DB = $this->conexion();
            return $DB->query($sql);
        }
    }
?>
